export default {
    namespaced: true, 
    state: {
        count: 0
    },
    mutations: {  
        increment(state, payload) { //commit('model/increment')
            state.count = payload.count;
        }
    },
    actions: {//Action 提交的是 mutation
        increment({ commit }, payload) { // 使用结构来简化代码
            setTimeout(() => {
                commit({
                    type:"increment",
                    count:payload.count
                })
            }, 1000)
        }
    }
}